package com.example.app.data.enum

import com.example.app.R

enum class BorderState(
    var label: String,
    var value: Any,
    var key: String
) {







    //边框的位置
    BORDER_TOP(
        "上",
        "top",
        "BORDER_TOP"
    ),
    //边框的位置
    BORDER_LEFT(
        "上",
        "top",
        "BORDER_LEFT"
    ),
    //边框的位置
    BORDER_RIGHT(
        "右",
        "right",
        "BORDER_RIGHT"
    ),
    //边框的位置
    BORDER_BOTTOM(
        "下",
        "bottom",
        "BORDER_BOTTOM"
    )
    ;

    companion object {
        fun getVarByLabel(label: String): BorderState? {
            values().forEach {
                if (label == it.label) return it
            }
            return null
        }

        fun getVarByValue(value: Any): BorderState? {
            values().forEach {
                if (value == it.value) return it
            }
            return null
        }

        fun getVarByKey(key: String): BorderState? {
            values().forEach {
                if (it.key == key) return it
            }
            return null
        }
    }
}